home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / X / XtAppInitwIcon / README < prev    next >
Encoding:
Text File  |  1994-08-02  |  4.3 KB  |  118 lines

  1.  
  2.            ~4Dgifts/toolbox/src/exampleCode/X/XtAppInitwIcon README
  3.  
  4.  
  5.     /*******************************************************************/
  6.     /* XtAppInitializeWithIcon DESCRIPTION                             */
  7.     /* Date:        Mon Jul 12 11:56:51 1993               */
  8.     /* Author:        Chris Carlson                           */
  9.     /*******************************************************************/
  10.     
  11.     This directory contains the source code to a function that is the same
  12.     as XtAppInitialize except that it allows the application an
  13.     opportunity to generate an icon window for the top-level shell that is
  14.     a visual other than the default 2-color visual.  According to the
  15.     documentation for creating icon windows, it must have the same visual
  16.     type as the root window.
  17.     
  18.     REQUIREMENTS
  19.     ------------
  20.     
  21.     Currently, this has only been tested to work under IRIX 4.0.5.
  22.     
  23.     MAKE
  24.     ----
  25.     
  26.     To make everything, including the testicon program, enter the
  27.     following command:
  28.     
  29.         make testicon
  30.     
  31.     To make just the XtAppInitializeWithIcon function, enter the following
  32.     command:
  33.     
  34.         make
  35.     
  36.     USAGE
  37.     -----
  38.     
  39.     Prototype:
  40.         Widget XtAppInitializeWithIcon (XtAppContext     *context,
  41.                         String         class,
  42.                         XrmOptionDescRec *options,
  43.                         Cardinal     num_options,
  44.                         Cardinal     *argc,
  45.                         String         *argv,
  46.                         String         *fallback,
  47.                         ArgList         args,
  48.                         Cardinal     num_args,
  49.                         makeIcon     func_name);
  50.     
  51.         Window (*makeIcon) (Display  *dpy,
  52.                     Cardinal *argc,
  53.                     String   *argv);
  54.     
  55.     Parameters:
  56.         XtAppInitializeWithIcon:
  57.             All of the parameters are identical to the
  58.             XtAppInitialize function except 'func_name'.  This is
  59.             a pointer to a function which will be called at the
  60.             appropriate time in the initialization process to
  61.             create the icon window.
  62.     
  63.         makeIcon:
  64.             This is a function provided by the application to
  65.             create the icon window.
  66.     
  67.             dpy        Display returned by XtOpenDisplay.
  68.             argc    The same argc value provided by the application
  69.                 to XtAppInitializeWithIcon.
  70.             argv    The same argv value provided by the application
  71.                     to XtAppInitializeWithIcon.
  72.     
  73.             Return value:
  74.             Window ID of window created to be the icon.
  75.     
  76.     DEMO PROGRAM
  77.     ------------
  78.     
  79.     The testicon program that is also provided demonstrates how to use
  80.     this new function.  When compiled, the program can be made to print
  81.     various debug information by setting bit patterns in the DEBUG symbol.
  82.     These bits can be OR'd together to enable multiple debug output.
  83.     
  84.         VALUE    DEBUG OUTPUT
  85.         -----    ------------
  86.         0x0001    Print window IDs that are created.
  87.         0x0002    Print events that are sent to the icon window.
  88.         0x0004    Print information about colors allocated.
  89.         0x0008    Print information about the sizes of icons that are
  90.             available from the window manager.
  91.     
  92.     Basically, all the testicon program does is create a simple window
  93.     with a label widget in it.  It serves no purpose except to create an
  94.     icon window that is using the same visual as the root window.
  95.     
  96.     When this simple window is lowered to an icon, the icon should appear
  97.     as a blue background with a yellow box in it.  This proves that the
  98.     icon window is using a color visual.
  99.     
  100.     If the program was compiled with (DEBUG & 2) != 0, then all events
  101.     that are sent to the icon will be printed to stdout.  This can be
  102.     useful in finding out what events need to be processed and which are
  103.     actually available to the icon window for the application to process.
  104.     
  105.     MORE WORK REQUIRED
  106.     ------------------
  107.     
  108.     1. One thought would be to make the function actually create the
  109.        window for the application.  The problem with this is that there
  110.        are a number of variables that need to be considered when creating
  111.        the icon window that the application needs to decide on.  For
  112.        example, the icon size, window attributes, events to process and
  113.        background color.  This might be resolved with suggestion #2 below.
  114.     
  115.     2. Have the icon window be a widget and have XtAppInitializeWithIcon
  116.        return a widget through one of the passed parameters.  Then the
  117.        specifics can be set through resources.
  118.